package com.hbmcc.rxjava

import android.app.Application
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.tmall.wireless.tangram3.TangramBuilder
import com.tmall.wireless.tangram3.util.IInnerImageSetter

/**
 * 创建日期：2020/11/3
 * 描述:Rx application
 * 作者:支豪亮
 */
class RxApplication : Application() {
    override fun onCreate() {
        super.onCreate()
        //初始化
        TangramBuilder.init(this.applicationContext, object : IInnerImageSetter {
            override fun <IMAGE : ImageView?> doLoadImageUrl(view: IMAGE, url: String?) {
                if (url.isNullOrEmpty() || view == null) return
                Glide.with(this@RxApplication).load(url).into(view)
            }
        }, ImageView::class.java)
    }
}